package com.faxsun.core.pojos.enums;

import java.util.ArrayList;
import java.util.List;

public enum TagType {

	NORMAL(0), CATEGORY(1), PRODUCT(2), INVALID(13);
	int type;

	TagType(int type) {
		this.type = type;
	}

	public int getValue() {
		return this.type;
	}

	public static TagType parse(Integer type) {
		if(type==null)
			return INVALID;
		switch (type) {
		case 0:
			return NORMAL;
		case 1:
			return CATEGORY;
		case 2:
			return PRODUCT;
		default:
			return INVALID;
		}
	}
	
	public static List<TagType> list(){
		List<TagType> list=new ArrayList<TagType>();
		list.add(CATEGORY);
		list.add(NORMAL);
		list.add(PRODUCT);
		
		return list;
	}
}
